<?php echo $header; ?><?php echo $column_left; ?>
<div class="d4-col-right right">
			<?php echo $menu_content;?>
			<div class="padder">
				
					<div class="product-img-box">
						<p class="product-image">
							<a href="<?php echo $popup;?>#" rel="lightbox"><img id="image<?php echo $product_id; ?>" onerror=this.src='image/no_image.jpg' src="<?php echo $thumb;?>" width="300" height="226" /></a>
						</p>
					</div>

					<div class="product-info-box">
						<div class="category-head">
							<h2><?php echo $heading_title; ?></h2>
						</div>
						<div class="price-box">
							<span class="regular-price">Mã : <span class="price"><?php echo $model; ?></span></span>
						</div>						
						<p><?php if($short_des) echo $short_des; ?></p>
						<div class="price-box">
							<b style="font-size:20px;"><span style="color:black;">Giá bán : <span style="color:red;"><?php echo number_format($price) ;?> VNĐ / <?php echo $unit;?></span></span></b>
							<p>(Giá được cập nhật hàng ngày)</p>
						</div>
						<div class="add-to-boxes">
							<form id="product<?php echo $product_id; ?>" enctype="multipart/form-data" method="post" action="index.php?route=checkout/cart">
							<fieldset class="add-to-cart-box">
								<span class="qty-box"><label for="qty">Số lượng : </label>
								<input name="quantity" type="text" class="input-text qty" id="qty" maxlength="4" onkeypress="return numbersonly(this, event);" value="1"/></span>
								<a href="javascript:;" onclick="addtocart(<?php echo $product_id;?>);"><img src="catalog/view/theme/default/images/d4-btn-buy.png" alt="Add to Cart" class="v-middle" style="margin:0 0 0 5px;" /></a>
								 <div>
             						 <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
              						 <input type="hidden" name="redirect" value="<?php echo str_replace('&', '&amp;', $redirect); ?>" />                
             					 </div>
							</fieldset>
							</form>
						</div>
					</div>
					<div class="clear"></div>
			</div>

			<ul class="tabs">
                <li id="product_tabs_description" class="active first"><a href="#">Thông tin chi tiết</a></li>
                <li id="product_tabs_tags" ><a href="#">Ý kiến khách hàng</a></li>
            </ul>

			<div class="padder">

				<div id="product_tabs_description_contents">
					<div class="product-specs" style="font-size:12px;">
						<?php echo $description; ?>
					</div>
				</div>
				
				<div id="product_tabs_tags_contents">
					<div class="padder">
						<div id="review"></div>
						<br/>
						<?php if ($this->customer->isLogged()){?>
						<h5>Gửi phản hồi : </h5>
						<div class="content">
							<div class="add-tag-box">
								<form id="addTagForm" action="" method="get">
									<div class="input-box">
										<input type="hidden" name="name" value = "<?php echo $this->customer->getEmail(); ?>"/>
										<input type="hidden" name="rating" value="5"  />
										<input type="hidden" id="review_title"/>
										<textarea class="input-text required-entry" name="text" cols="140" rows="5"></textarea>
										<small>Nội dung phản hồi dưới 500 ký tự.</small><br/>
										<span style="color:red;">Mã xác nhận (*) : </span><input type="text" class="input-text required-entry" name="captcha" style="width:100px;" />
										<img  src="index.php?route=product/product/captcha" id="captcha" width="106" height="30" style="position:relative;top : 12px;" />
										<br/><br/>
										<div>
											<a id="review_button" href="javascript:;" onclick="review()"><img src="catalog/view/theme/default/images/btn_submit_1.gif" /></a>
										</div>
									</div>
									
									

								</form>
								<div class="clear"></div>
							</div>
						</div>
						<?php }else{?>
						<span style="color:red;">Cần đăng nhập để gửi phản hồi   </span>
						<?php }?>
					</div>
				</div>

            </div>

			<script type="text/javascript">
			Varien.Tabs = Class.create();
			Varien.Tabs.prototype = {
			  initialize: function(selector) {
				var self=this;
				$$(selector+' a').each(this.initTab.bind(this));
			  },
			  initTab: function(el) {
				  el.href = 'javascript:void(0)';
				  if ($(el.parentNode).hasClassName('active')) {
					this.showContent(el);
				  }
				  el.observe('click', this.showContent.bind(this, el));
			  },
			  showContent: function(a) {
				var li = $(a.parentNode), ul = $(li.parentNode);
				ul.getElementsBySelector('li', 'ol').each(function(el){
				  var contents = $(el.id+'_contents');
				  if (el==li) {
					el.addClassName('active');
					contents.show();
				  } else {
					el.removeClassName('active');
					contents.hide();
				  }
				});
			  }
			}
			new Varien.Tabs('.tabs');
			</script>
		</div>			
    </div>
<script type="text/javascript"><!--
$j('#review .amount .links a').live('click', function() {
	$j('#review').slideUp('slow');
		
	$j('#review').load(this.href);

	$j('#review').slideDown('slow');
	
	return false;
});			

$j('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>&page=<?php echo $page; ?>');

function review() {
	$j.ajax({
		type: 'POST',
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($j('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($j('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($j('input[name=\'rating\']').val()) + '&captcha=' + encodeURIComponent($j('input[name=\'captcha\']').val()),
		beforeSend: function() {
			$j('.success, .warning').remove();
			$j('#review_button').attr('disabled', 'disabled');
			$j('#review_title').after('<div class="wait"><img src="catalog/view/theme/default/images/loading_1.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$j('#review_button').attr('disabled', '');
			$j('.wait').remove();
		},
		success: function(data) {
			if (data.error) {
				$j('#review_title').after('<div style="color:red" class="warning">' + data.error + '</div>');
			}
			
			if (data.success) {
				$j('#review_title').after('<div style="color:green" class="success">' + data.success + '</div>');
							
				$j('textarea[name=\'text\']').val('');
				$j('input[name=\'captcha\']').val('');
				$j('#review').slideUp('slow');
				$j('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
				$j('#review').slideDown('slow');
			}
		}
	});
}
//--></script>
<script type="text/javascript"><!--
$.tabs('.tabs a'); 
//--></script>
<script type="text/javascript">
			<!--
			function numbersonly(myfield, e)
			{
			var key;
			var keychar;
			if (window.event)
			key = window.event.keyCode;
			else if (e)
			key = e.which;
			else
			return true;
			keychar = String.fromCharCode(key);
			// control keys
			if ((key==null) || (key==0) || (key==8) ||
			(key==9) || (key==27) || (key==13) || (key==46))
			return true;
			// numbers
			else if ((("0123456789").indexOf(keychar) > -1))
			return true;
			// decimal point jump
			else
			return false;
			}
			//-->
</script> 
<?php echo $footer; ?> 